package com.bing.utils;

import com.bing.bean.weixin.EventType;
import com.bing.bean.weixin.MsgType;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * Created by kaibb on 2014/11/29.
 */
public class EventTypeAdapter extends XmlAdapter<String, EventType> {

    @Override
    public EventType unmarshal(String v) throws Exception {
        return EventType.valueOf(v);
    }

    @Override
    public String marshal(EventType v) throws Exception {
        return "<![CDATA[" + v.toString() + "]]>";
    }
}
